package com.dmzapp.api.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PatternUtil {
    
    public static boolean isMobileNO(String mobiles) {
        Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
        Matcher m = p.matcher(mobiles);
        return m.matches();
    }

    public static boolean isEmail(String email) {
        String str = "^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$";
        Pattern p = Pattern.compile(str);
        Matcher m = p.matcher(email);
        return m.matches();
    }

    public static boolean isQQ(String qq) {
        String str = "[1-9][0-9]{4,14}";
        Pattern p = Pattern.compile(str);
        Matcher m = p.matcher(qq);
        return m.matches();
    }
    
    public static void main(String[] args) {
        System.out.println(isMobileNO("139094025968"));
    }
}